package models;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;



import play.data.validation.Required;
import play.db.jpa.Model;

/**
 * Audit book copy history
 *
 */
@Entity
public class BookHistory extends Model {

	@ManyToOne
	public BookCopy bookCopy;
	
	@Temporal(TemporalType.DATE)
	public Date takenDate;
	
	@Temporal(TemporalType.DATE)
	public Date declaredReturnDate;
	
	@Temporal(TemporalType.DATE)
	public Date returnDate;
	
	@ManyToOne
	@Required
	public User borrower;
	
	@ManyToOne
	@Required
	public User librarian;
	
}
